*******************************************************
*** 				Replication of					***
*** "Raising Health Awareness in Rural Communities" ***
*** by Siddique, Rahman, Pakrashi, Islam, Ahmed		***
*******************************************************


***************************
* MAIN FIGURES AND TABLES *
***************************


*************************************************************************************************
*FIGURE 1
/*
This figure is our project timeline and does not have any replication data or codes.
*/
*************************************************************************************************


*************************************************************************************************
*FIGURE 2: Summary of results
//Install "cibar" command by running:
ssc install cibar

*Column A Bangladesh
//Import the following data: Data_Covid_BD_wave_1.dta

//Graph A1
cibar tot_ans, over(treat) graphopts(title("Column A: Bangladesh") subtitle("A1. Awareness (scale between 0-5)") ytitle("Number of Correct Responses") yscale(range(0 5)) ylabel(0(1)5) graphregion(color(white))) barcolor(gs3 gs8 gs13)

//Graph A2
cibar all_ans, over(treat) graphopts(subtitle("A2. Complete Awareness") ytitle("Proportion of All Correct Responses") yscale(range(0 1)) ylabel(0(0.2)1) graphregion(color(white))) barcolor(gs3 gs8 gs13)

//Graph A3
cibar comply, over(treat) graphopts(subtitle("A3. Compliance (scale between 0-1)") ytitle("Proportion") yscale(range(0.5 1)) ylabel(0.5(0.1)1) graphregion(color(white))  legend(col(1)))  barcolor(gs3 gs8 gs13)

clear

*Column B India
//Import the following data: Data_Covid_India.dta

//Graph B1
cibar total_ans, over(treat) graphopts(title("Column B: India") subtitle("B1. Awareness (scale between 0-5)") ytitle("Number of Correct Responses") yscale(range(0 5)) ylabel(0(1)5) graphregion(color(white)) scheme(s2color)) barcolor(gs3 gs8 gs13) 

//Graph B2
cibar all_ans , over(treat) graphopts(subtitle("B2. Complete Awareness") ytitle("Proportion of All Correct Responses") yscale(range(0 1)) ylabel(0(0.2)1)  graphregion(color(white))) barcolor(gs3 gs8 gs13)

//Graph B3
cibar comply, over(treat) graphopts(subtitle("B3. Compliance (scale between 0-1)") ytitle("Proportion") yscale(range(0.5 1)) ylabel(0.5(0.1)1)  graphregion(color(white))  legend(col(1))) barcolor(gs3 gs8 gs13)

clear
*************************************************************************************************


*************************************************************************************************
*FIGURE 3: Effect on compliance, pooled and by gender

ssc install blindschemes
ssc install coefplot

*Graph A Bangladesh
//Import the "Coefficents_BD.csv" file using: import delimited "C:\.....\Coefficents_BD.csv". This data file is in the folder "Figure 3 Data".


//run the follwing at once
gen se=.
replace se= beta/t

gen max=invttail(6485, 0.005)
gen min=invttail(6485, 0.025)

gen max95b=beta+se*max
gen max90b=beta+se*min

gen min95b=beta-se*max
gen min90b=beta-se*min

gen order=_n

set scheme plotplainblind

graph set window fontface "Segoe UI Light"

mkmat beta min90b max90b min95b max95b, matrix(A)

matrix A2=A`j''

mat list A`j'2

coefplot matrix(A2[1,]), ci((2 3) (4 5)) xline(0, lwidth(medium) lcolor(gray) lpattern(solid)) ///
xscale(range(-0.5 2.00)) ///
ylabel(, labsize(vsmall) nogrid) ///
xlabel(-0.5(0.5)2.00, labsize(small)) xtitle("Effect size in standard deviations of the control group") ///
title("A. Bangladesh", size(large)) ///
coeflabels( r1="Call Only" ///
             r2="Text & Call"  ///
             r3="Call Only"  ///
			 r4="Text & Call" ///
			 r5="Call Only" ///
			 r6="Text & Call" ///
             ) /// 
msize(vsmall) headings(r1= "Pooled" r3="Women" r5= "Men", labsize(medium)) ///
ciopts(recast(rcap rspike) lwidth(medium thin)) graphreg(color(gs16)) aspectratio(1) ///

//graph play pink_change.grec

graph save "coefplot_bd.gph", replace

clear


*Graph B India
//Import the "Coefficents_india.csv" file using: import delimited "C:\.....\Coefficents_india.csv". This data file is in the folder "Figure 3 Data".

//run the follwing at once
gen se=. 
replace se= beta/t

gen max=invttail(1679, 0.005)
gen min=invttail(1679, 0.025)

gen max95b=beta+se*max
gen max90b=beta+se*min

gen min95b=beta-se*max
gen min90b=beta-se*min

gen order=_n

set scheme plotplainblind

graph set window fontface "Segoe UI Light"

mkmat beta min90b max90b min95b max95b, matrix(A)

matrix A2=A`j''

mat list A`j'2

coefplot matrix(A2[1,]), ci((2 3) (4 5)) xline(0, lwidth(medium) lcolor(gray) lpattern(solid)) ///
xscale(range(-0.5 3)) ///
ylabel(, labsize(vsmall) nogrid) ///
xlabel(-0.5(0.5)3, labsize(small)) xtitle("Effect size in standard deviations of the control group") ///
title("B. India", size(large)) ///
coeflabels( r1="Call Only" ///
             r2="Text & Call"  ///
             r3="Call Only"  ///
			 r4="Text & Call" ///
			 r5="Call Only" ///
			 r6="Text & Call" ///
             ) /// 
msize(vsmall) headings(r1= "Pooled" r3="Women" r5= "Men", labsize(medium)) ///
ciopts(recast(rcap rspike) lwidth(medium thin)) graphreg(color(gs16)) aspectratio(1) ///

//graph play pink_change.grec

graph save "coefplot_india.gph", replace

clear

//Join Graphs A and B to get the final output
graph combine coefplot_bd.gph coefplot_india.gph,  saving(compliance, replace)

clear
*************************************************************************************************


*************************************************************************************************
*TABLE 1: Sample characteristics and balance checks

** Panel A [BANGLADESH]
//Import the following data: Data_Covid_BD_wave_1.dta
summ age_respondent edu_respondent Monthly_income nmember Gender_res rel_islam professional farmer1 laborer1 selfemployed //Column All
summ age_respondent edu_respondent Monthly_income nmember Gender_res rel_islam professional farmer1 laborer1 selfemployed if treat==1 //Column T1
summ age_respondent edu_respondent Monthly_income nmember Gender_res rel_islam professional farmer1 laborer1 selfemployed if treat==2 //Column T2
summ age_respondent edu_respondent Monthly_income nmember Gender_res rel_islam professional farmer1 laborer1 selfemployed if treat==3 //Column T3

//For the remaining 3 columns
regress age_respondent i.treat if treat!=3, cl(VILLAGE_ID) // T2 - T1
regress age_respondent i.treat if treat!=2, cl(VILLAGE_ID) // T3 - T1
regress age_respondent i.treat if treat!=1, cl(VILLAGE_ID) // T3 - T2

regress edu_respondent i.treat if treat!=3, cl(VILLAGE_ID) // T2 - T1
regress edu_respondent i.treat if treat!=2, cl(VILLAGE_ID) // T3 - T1
regress edu_respondent i.treat if treat!=1, cl(VILLAGE_ID) // T3 - T2

regress Monthly_income i.treat if treat!=3, cl(VILLAGE_ID) // T2 - T1
regress Monthly_income i.treat if treat!=2, cl(VILLAGE_ID) // T3 - T1
regress Monthly_income i.treat if treat!=1, cl(VILLAGE_ID) // T3 - T2

regress nmember i.treat if treat!=3, cl(VILLAGE_ID) // T2 - T1
regress nmember i.treat if treat!=2, cl(VILLAGE_ID) // T3 - T1
regress nmember i.treat if treat!=1, cl(VILLAGE_ID) // T3 - T2

regress Gender_res i.treat if treat!=3, cl(VILLAGE_ID) // T2 - T1
regress Gender_res i.treat if treat!=2, cl(VILLAGE_ID) // T3 - T1
regress Gender_res i.treat if treat!=1, cl(VILLAGE_ID) // T3 - T2

regress rel_islam i.treat if treat!=3, cl(VILLAGE_ID) // T2 - T1
regress rel_islam i.treat if treat!=2, cl(VILLAGE_ID) // T3 - T1
regress rel_islam i.treat if treat!=1, cl(VILLAGE_ID) // T3 - T2

regress occupation i.treat if treat!=3, cl(VILLAGE_ID) // T2 - T1
regress occupation i.treat if treat!=2, cl(VILLAGE_ID) // T3 - T1
regress occupation i.treat if treat!=1, cl(VILLAGE_ID) // T3 - T2

clear

*For the "% Non-attritors" row, do the follwoing:
//Import the following data: Data_attrition_BD.dta

//Generate a new varibale for non attrition
gen attrit2=0 
replace attrit2=1 if attrit==0

//First 4 columns:
summ attrit2 //Column All
summ attrit2 if treat==1 //Column T1 
summ attrit2 if treat==2 //Column T2
summ attrit2 if treat==3 //Column T3

//For the remaining 3 columns:
regress attrit2 i.treat if treat3!=1, cl(VILLAGE_ID) //  T2 - T1
regress attrit2 i.treat if treat2!=1, cl(VILLAGE_ID) //  T3 - T1
regress attrit2 i.treat if treat1!=1, cl(VILLAGE_ID) //  T3 - T2

clear


//Panel B: INDIA
//Import the follwing data: Data_Covid_India.dta

//First 4 columns
summ age college male urban income joint own_house disability married em long_term hindu caste_c1 caste_c2 caste_c3 caste_c4 //Column All
summ age college male income joint own_house disability married em long_term hindu caste_c1 caste_c2 caste_c3 caste_c4 if treat==1 //Column T1 
summ age college male income joint own_house disability married em long_term hindu caste_c1 caste_c2 caste_c3 caste_c4 if treat==2 //Column T2
summ age college male income joint own_house disability married em long_term hindu caste_c1 caste_c2 caste_c3 caste_c4 if treat==3 //Column T3

regress age i.treat if treat!=3, cl(location) // T2 - T1
regress age i.treat if treat!=2, cl(location) // T3 - T1
regress age i.treat if treat!=1, cl(location) // T3 - T2

regress college i.treat if treat!=3, cl(location) // T2 - T1
regress college i.treat if treat!=2, cl(location) // T3 - T1
regress college i.treat if treat!=1, cl(location) // T3 - T2

regress male i.treat if treat!=3, cl(location) // T2 - T1
regress male i.treat if treat!=2, cl(location) // T3 - T1
regress male i.treat if treat!=1, cl(location) // T3 - T2

regress urban i.treat if treat!=3, cl(location) // T2 - T1
regress urban i.treat if treat!=2, cl(location) // T3 - T1
regress urban i.treat if treat!=1, cl(location) // T3 - T2

regress income i.treat if treat!=3, cl(location) // T2 - T1
regress income i.treat if treat!=2, cl(location) // T3 - T1
regress income i.treat if treat!=1, cl(location) // T3 - T2

regress joint i.treat if treat!=3, cl(location) // T2 - T1
regress joint i.treat if treat!=2, cl(location) // T3 - T1
regress joint i.treat if treat!=1, cl(location) // T3 - T2

regress own_house i.treat if treat!=3, cl(location) // T2 - T1
regress own_house i.treat if treat!=2, cl(location) // T3 - T1
regress own_house i.treat if treat!=1, cl(location) // T3 - T2

regress disability i.treat if treat!=3, cl(location) // T2 - T1
regress disability i.treat if treat!=2, cl(location) // T3 - T1
regress disability i.treat if treat!=1, cl(location) // T3 - T2

regress married i.treat if treat!=3, cl(location) // T2 - T1
regress married i.treat if treat!=2, cl(location) // T3 - T1
regress married i.treat if treat!=1, cl(location) // T3 - T2

regress em i.treat if treat!=3, cl(location) // T2 - T1
regress em i.treat if treat!=2, cl(location) // T3 - T1
regress em i.treat if treat!=1, cl(location) // T3 - T2

regress long_term i.treat if treat!=3, cl(location) // T2 - T1
regress long_term i.treat if treat!=2, cl(location) // T3 - T1
regress long_term i.treat if treat!=1, cl(location) // T3 - T2

regress hindu i.treat if treat!=3, cl(location) // T2 - T1
regress hindu i.treat if treat!=2, cl(location) // T3 - T1
regress hindu i.treat if treat!=1, cl(location) // T3 - T2

regress caste i.treat if treat!=3, cl(location) // T2 - T1
regress caste i.treat if treat!=2, cl(location) // T3 - T1
regress caste i.treat if treat!=1, cl(location) // T3 - T2


*For the "% Non-attritors" row, do the follwoing:
//Import the following data: Data_attrition_India.dta

//Generate a new varibale for non attrition
gen attrit2=0
replace attrit2=1 if attrition==0

//First 4 columns:
summ attrit2 //Column All
summ attrit2 if treat_a==1 //Column T1
summ attrit2 if treat_a==2 //Column T2
summ attrit2 if treat_a==3 //Column T3

//The remaining 3 columns:
regress attrit2 i.treat_a if treat3!=1, cl(location) //  T2 - T1
regress attrit2 i.treat_a if treat2!=1, cl(location) //  T3 - T1
regress attrit2 i.treat_a if treat1!=1, cl(location) //  T3 - T2

clear
*************************************************************************************************


*************************************************************************************************
*TABLE 2: Treatment effects on COVID-19 awareness
//Install outreg2
ssc install outreg2

*Panel A: Bangladesh
//Import the following data: Data_Covid_BD_wave_1.dta

reg tot_ans treat2 treat3 i.UNION_CODE, vce(cluster VILLAGE_ID)
outreg2 using reg101.tex, append ctitle(1) dec(3) keep(treat2 treat3)

reg tot_ans treat2 treat3 Gender_res rel_islam i.occupation i.insec health_worry finance_worry i.UNION_CODE, vce(cluster VILLAGE_ID)
outreg2 using reg101.tex, append ctitle(2) dec(3) keep(treat2 treat3)

reg tot_ans treat2 treat3 age_respondent edu_respondent Gender_res rel_islam log_income nmember i.occupation i.insec media_exp health_worry finance_worry i.UNION_CODE, vce(cluster VILLAGE_ID)
outreg2 using reg101.tex, append ctitle(3) dec(3) keep(treat2 treat3)

reg all_ans treat2 treat3 i.UNION_CODE, vce(cluster VILLAGE_ID)
outreg2 using reg101.tex, append ctitle(4) dec(3) keep(treat2 treat3)

reg all_ans treat2 treat3 Gender_res rel_islam i.occupation i.insec health_worry finance_worry i.UNION_CODE, vce(cluster VILLAGE_ID)
outreg2 using reg101.tex, append ctitle(5) dec(3) keep(treat2 treat3)

reg all_ans treat2 treat3 age_respondent edu_respondent Gender_res rel_islam log_income nmember i.occupation i.insec media_exp health_worry finance_worry i.UNION_CODE, vce(cluster VILLAGE_ID)
outreg2 using reg101.tex, append ctitle(6) dec(3) keep(treat2 treat3)


//Generate T1 means and standard deviations
summ tot_ans all_ans if treat1==1


//F-test p-values
reg tot_ans treat2 treat3 i.UNION_CODE, vce(cluster VILLAGE_ID)
test treat2=treat3

reg tot_ans treat2 treat3 Gender_res rel_islam i.occupation i.insec health_worry finance_worry i.UNION_CODE, vce(cluster VILLAGE_ID)
test treat2=treat3

reg tot_ans treat2 treat3 age_respondent edu_respondent Gender_res rel_islam log_income nmember i.occupation i.insec media_exp health_worry finance_worry i.UNION_CODE, vce(cluster VILLAGE_ID)
test treat2=treat3

reg all_ans treat2 treat3 i.UNION_CODE, vce(cluster VILLAGE_ID)
test treat2=treat3

reg all_ans treat2 treat3 Gender_res rel_islam i.occupation i.insec health_worry finance_worry i.UNION_CODE, vce(cluster VILLAGE_ID)
test treat2=treat3

reg all_ans treat2 treat3 age_respondent edu_respondent Gender_res rel_islam log_income nmember i.occupation i.insec media_exp health_worry finance_worry i.UNION_CODE, vce(cluster VILLAGE_ID)
test treat2=treat3


//Westfall-Young FWER p-values
//net install wyoung, from("https://raw.githubusercontent.com/reifjulian/wyoung/master") replace
wyoung, cmd("reg tot_ans treat2 treat3 i.UNION_CODE, vce(cluster VILLAGE_ID)" "reg tot_ans treat2 treat3 i.UNION_CODE, vce(cluster VILLAGE_ID)" "reg tot_ans treat2 treat3 Gender_res rel_islam i.occupation i.insec health_worry finance_worry i.UNION_CODE, vce(cluster VILLAGE_ID)" "reg tot_ans treat2 treat3 Gender_res rel_islam i.occupation i.insec health_worry finance_worry i.UNION_CODE, vce(cluster VILLAGE_ID)" "reg tot_ans treat2 treat3 age_respondent edu_respondent Gender_res rel_islam log_income nmember i.occupation i.insec media_exp health_worry finance_worry i.UNION_CODE, vce(cluster VILLAGE_ID)" "reg tot_ans treat2 treat3 age_respondent edu_respondent Gender_res rel_islam log_income nmember i.occupation i.insec media_exp health_worry finance_worry i.UNION_CODE, vce(cluster VILLAGE_ID)" "reg all_ans treat2 treat3 i.UNION_CODE, vce(cluster VILLAGE_ID)" "reg all_ans treat2 treat3 i.UNION_CODE, vce(cluster VILLAGE_ID)" "reg all_ans treat2 treat3 Gender_res rel_islam i.occupation i.insec health_worry finance_worry i.UNION_CODE, vce(cluster VILLAGE_ID)" "reg all_ans treat2 treat3 Gender_res rel_islam i.occupation i.insec health_worry finance_worry i.UNION_CODE, vce(cluster VILLAGE_ID)" "reg all_ans treat2 treat3 age_respondent edu_respondent Gender_res rel_islam log_income nmember i.occupation i.insec media_exp health_worry finance_worry i.UNION_CODE, vce(cluster VILLAGE_ID)" "reg all_ans treat2 treat3 age_respondent edu_respondent Gender_res rel_islam log_income nmember i.occupation i.insec media_exp health_worry finance_worry i.UNION_CODE, vce(cluster VILLAGE_ID)") familyp(treat2 treat3 treat2 treat3 treat2 treat3 treat2 treat3 treat2 treat3 treat2 treat3) bootstrap(1000) force //


//Randomization Inference p-values
//ssc install randcmd
randcmd ((treat2 treat3) reg tot_ans treat2 treat3 i.UNION_CODE, vce(cluster VILLAGE_ID)) ((treat2 treat3) reg tot_ans treat2 treat3 Gender_res rel_islam i.occupation i.insec health_worry finance_worry i.UNION_CODE, vce(cluster VILLAGE_ID)) ((treat2 treat3) reg tot_ans treat2 treat3 age_respondent edu_respondent Gender_res rel_islam log_income nmember i.occupation i.insec media_exp health_worry finance_worry i.UNION_CODE, vce(cluster VILLAGE_ID)) ((treat2 treat3) reg all_ans treat2 treat3 i.UNION_CODE, vce(cluster VILLAGE_ID)) ((treat2 treat3) reg all_ans treat2 treat3 Gender_res rel_islam i.occupation i.insec health_worry finance_worry i.UNION_CODE, vce(cluster VILLAGE_ID)) ((treat2 treat3) reg all_ans treat2 treat3 age_respondent edu_respondent Gender_res rel_islam log_income nmember i.occupation i.insec media_exp health_worry finance_worry i.UNION_CODE, vce(cluster VILLAGE_ID)), treatvars(treat2 treat3) seed(1234) reps(1000)

clear


*Panel B India
//Import the following data: Data_Covid_India.dta

reg total_ans treat2 treat3 i.location, vce(cluster location)
outreg2 using reg1.tex, append ctitle(1) dec(3) keep(treat2 treat3)

reg total_ans treat2 treat3 age male hindu i.caste2 log_inc college i.urban i.joint i.own_house disability married i.employed i.location,  vce(cluster location)
outreg2 using reg1.tex, append ctitle(2) dec(3) keep(treat2 treat3)

reg total_ans treat2 treat3 age male hindu i.caste2 log_inc college i.urban i.joint i.own_house disability married i.employed health_risk health_worry finance_worry insec i.long_term i.occupation i.location, vce(cluster location)
outreg2 using reg1.tex, append ctitle(3) dec(3) keep(treat2 treat3)

reg all_ans treat2 treat3 i.location,  vce(cluster location)
outreg2 using reg1.tex, append ctitle(4) dec(3) keep(treat2 treat3)

reg all_ans treat2 treat3 age male hindu i.caste2 log_inc college i.urban i.joint i.own_house disability married i.employed i.location,  vce(cluster location) 
outreg2 using reg1.tex, append ctitle(5) dec(3) keep(treat2 treat3)

reg all_ans treat2 treat3 age male hindu i.caste2 log_inc college i.urban i.joint i.own_house disability married i.employed health_risk health_worry finance_worry insec i.long_term i.occupation i.location, vce(cluster location)
outreg2 using reg1.tex, append ctitle(6) dec(3) keep(treat2 treat3)


//Generate T1 averages and standard deviations
summ total_ans all_ans if treat==1


//F-test p-values
reg total_ans treat2 treat3 i.location, vce(cluster location)
test treat2=treat3

reg total_ans treat2 treat3 age male hindu i.caste2 log_inc college i.urban i.joint i.own_house disability married i.employed i.location,  vce(cluster location)
test treat2=treat3

reg total_ans treat2 treat3 age male hindu i.caste2 log_inc college i.urban i.joint i.own_house disability married i.employed health_risk health_worry finance_worry insec i.long_term i.occupation i.location, vce(cluster location)
test treat2=treat3

reg all_ans treat2 treat3 i.location,  vce(cluster location)
test treat2=treat3

reg all_ans treat2 treat3 age male hindu i.caste2 log_inc college i.urban i.joint i.own_house disability married i.employed i.location,  vce(cluster location) 
test treat2=treat3

reg all_ans treat2 treat3 age male hindu i.caste2 log_inc college i.urban i.joint i.own_house disability married i.employed health_risk health_worry finance_worry insec i.long_term i.occupation i.location, vce(cluster location)
test treat2=treat3



//Westfall-Young FWER p-values
net install wyoung, from("https://raw.githubusercontent.com/reifjulian/wyoung/master") replace

wyoung, cmd("reg total_ans treat2 treat3 i.location, vce(cluster location)" "reg total_ans treat2 treat3 i.location, vce(cluster location)" "reg total_ans treat2 treat3 age male hindu i.caste2 log_inc college i.urban i.joint i.own_house disability married i.employed i.location,  vce(cluster location)" "reg total_ans treat2 treat3 age male hindu i.caste2 log_inc college i.urban i.joint i.own_house disability married i.employed i.location,  vce(cluster location)" "reg total_ans treat2 treat3 age male hindu i.caste2 log_inc college i.urban i.joint i.own_house disability married i.employed health_risk health_worry finance_worry insec i.long_term i.occupation i.location, vce(cluster location)" "reg total_ans treat2 treat3 age male hindu i.caste2 log_inc college i.urban i.joint i.own_house disability married i.employed health_risk health_worry finance_worry insec i.long_term i.occupation i.location, vce(cluster location)" "reg all_ans treat2 treat3 i.location,  vce(cluster location)" "reg all_ans treat2 treat3 i.location,  vce(cluster location)" "reg all_ans treat2 treat3 age male hindu i.caste2 log_inc college i.urban i.joint i.own_house disability married i.employed i.location,  vce(cluster location)" "reg all_ans treat2 treat3 age male hindu i.caste2 log_inc college i.urban i.joint i.own_house disability married i.employed i.location,  vce(cluster location)" "reg all_ans treat2 treat3 age male hindu i.caste2 log_inc college i.urban i.joint i.own_house disability married i.employed health_risk health_worry finance_worry insec i.long_term i.occupation i.location, vce(cluster location)" "reg all_ans treat2 treat3 age male hindu i.caste2 log_inc college i.urban i.joint i.own_house disability married i.employed health_risk health_worry finance_worry insec i.long_term i.occupation i.location, vce(cluster location)") familyp(treat2 treat3 treat2 treat3 treat2 treat3 treat2 treat3 treat2 treat3 treat2 treat3) bootstrap(1000) force


//Randomization Inference p-values
ssc install randcmd

randcmd ((treat2 treat3) reg total_ans treat2 treat3 i.location, vce(cluster location)) ((treat2 treat3) reg total_ans treat2 treat3 age male hindu i.caste2 log_inc college i.urban i.joint i.own_house disability married i.employed i.location,  vce(cluster location)) ((treat2 treat3) reg total_ans treat2 treat3 age male hindu i.caste2 log_inc college i.urban i.joint i.own_house disability married i.employed health_risk health_worry finance_worry insec i.long_term i.occupation i.location, vce(cluster location)) ((treat2 treat3) reg all_ans treat2 treat3 i.location,  vce(cluster location)) ((treat2 treat3) reg all_ans treat2 treat3 age male hindu i.caste2 log_inc college i.urban i.joint i.own_house disability married i.employed i.location,  vce(cluster location)) ((treat2 treat3) reg all_ans treat2 treat3 age male hindu i.caste2 log_inc college i.urban i.joint i.own_house disability married i.employed health_risk health_worry finance_worry insec i.long_term i.occupation i.location, vce(cluster location)), treatvars(treat2 treat3) seed(1234) reps(1000)


//Wild bootstrap-t cluster (CGM p-values)
ssc install boottest

reg total_ans treat2 treat3 i.location, vce(cluster location)
boottest treat2, boottype(wild) bootcluster(location) statistic(t) reps(1000) seed(1234) 
boottest treat3, boottype(wild) bootcluster(location) statistic(t) reps(1000) seed(1234)

reg total_ans treat2 treat3 age male hindu i.caste2 log_inc college i.urban i.joint i.own_house disability married i.employed i.location,  vce(cluster location)
boottest treat2, boottype(wild) bootcluster(location) statistic(t) reps(1000) seed(1234)
boottest treat3, boottype(wild) bootcluster(location) statistic(t) reps(1000) seed(1234)

reg total_ans treat2 treat3 age male hindu i.caste2 log_inc college i.urban i.joint i.own_house disability married i.employed health_risk health_worry finance_worry insec i.long_term i.occupation i.location, vce(cluster location)
boottest treat2, boottype(wild) bootcluster(location) statistic(t) reps(1000) seed(1234)  
boottest treat3, boottype(wild) bootcluster(location) statistic(t) reps(1000) seed(1234)

reg all_ans treat2 treat3 i.location,  vce(cluster location)
boottest treat2, boottype(wild) bootcluster(location) statistic(t) reps(1000) seed(1234) 
boottest treat3, boottype(wild) bootcluster(location) statistic(t) reps(1000) seed(1234)

reg all_ans treat2 treat3 age male hindu i.caste2 log_inc college i.urban i.joint i.own_house disability married i.employed i.location,  vce(cluster location) 
boottest treat2, boottype(wild) bootcluster(location) statistic(t) reps(1000) seed(1234)   
boottest treat3, boottype(wild) bootcluster(location) statistic(t) reps(1000) seed(1234)

reg all_ans treat2 treat3 age male hindu i.caste2 log_inc college i.urban i.joint i.own_house disability married i.employed health_risk health_worry finance_worry insec i.long_term i.occupation i.location, vce(cluster location)
boottest treat2, boottype(wild) bootcluster(location) statistic(t) reps(1000) seed(1234)  
boottest treat3, boottype(wild) bootcluster(location) statistic(t) reps(1000) seed(1234)


clear
*************************************************************************************************


*************************************************************************************************
*TABLE 3: Treatment effects on COVID-19 compliance

*Columns 1-3: BANGLADESH Endline 1
//Import the follwing data: Data_Covid_BD_wave_1.dta

//Run the following regressions to generate estimates as in Columns 1-3 in Table 3
reg compidx treat2 treat3 Gender_res rel_islam i.occupation i.insec health_worry finance_worry i.UNION_CODE, vce(cluster VILLAGE_ID)
outreg2 using reg1000.tex, append ctitle(1)  dec(3) keep(treat2 treat3) 

reg compidx treat2 treat3 age_respondent edu_respondent Gender_res rel_islam log_income nmember i.occupation i.insec media_exp health_worry finance_worry i.UNION_CODE, vce(cluster VILLAGE_ID)
outreg2 using reg1000.tex, append ctitle(2)  dec(3) keep(treat2 treat3)

reg compidx treat2 treat3 age_respondent edu_respondent rel_islam log_income nmember i.occupation i.insec media_exp health_worry finance_worry i.UNION_CODE if Gender_res==0, vce(cluster VILLAGE_ID)
outreg2 using reg1000.tex, append ctitle(3)  dec(3) keep(treat2 treat3)

//RI p-values
randcmd ((treat2 treat3) reg compidx treat2 treat3 Gender_res rel_islam i.occupation i.insec health_worry finance_worry i.UNION_CODE, vce(cluster VILLAGE_ID)) ((treat2 treat3) reg compidx treat2 treat3 age_respondent edu_respondent Gender_res rel_islam log_income nmember i.occupation i.insec media_exp health_worry finance_worry i.UNION_CODE, vce(cluster VILLAGE_ID)) ((treat2 treat3) reg compidx treat2 treat3 age_respondent edu_respondent rel_islam log_income nmember i.occupation i.insec media_exp health_worry finance_worry i.UNION_CODE if Gender_res==0, vce(cluster VILLAGE_ID)), treatvars(treat2 treat3) seed(1234) reps(1000)

clear


//Column 4: BANGLADESH Endline 2
//Import the follwing data: Data_Covid_BD_wave_2.dta

//Run the following regression to generate estimates as in Column 4 in Table 3
reg compidx treat2 treat3 age_respondent edu_respondent rel_islam log_income nmember i.occupation i.insec2 hhchore media_exp health_worry finance_worry i.UNION_CODE, vce(cluster VILLAGE_ID)
outreg2 using reg1000.tex, append ctitle(4)  dec(3) keep(treat2 treat3) 

//RI p-values
randcmd ((treat2 treat3) reg compidx treat2 treat3 age_respondent edu_respondent rel_islam log_income nmember i.occupation i.insec2 hhchore media_exp health_worry finance_worry i.UNION_CODE, vce(cluster VILLAGE_ID)), treatvars(treat2 treat3) seed(1234) reps(1000)

clear


//Column 5: INDIA 
//Import the follwing data: Data_Covid_India.dta

//Then run the following regression to generate estimates as in Column 5 in Table 3
reg compidx treat2 treat3 age male hindu i.caste2 log_inc college i.urban i.joint i.own_house disability married i.employed health_risk health_worry finance_worry insec i.long_term i.occupation i.location, vce(cluster location)
outreg2 using reg1000.tex, append ctitle(5) dec(3)  keep(treat2 treat3)

//CGM p-values
boottest treat2, boottype(wild) bootcluster(location) statistic(t) reps(1000) seed(1234) 
boottest treat3, boottype(wild) bootcluster(location) statistic(t) reps(1000) seed(1234)

//RI p-values
randcmd ((treat2 treat3) reg market3 treat2 treat3 age male hindu i.caste2 log_inc college i.urban i.joint i.own_house disability married i.employed health_risk health_worry finance_worry insec i.long_term i.occupation i.location, vce(cluster location)), treatvars(treat2 treat3) seed(1234) reps(1000)

clear
*************************************************************************************************


*************************************************************************************************
*TABLE 4: Compliance in Bangladesh: treatment-on-treated effects
ssc install ivreg2
ssc install ranktest

//Import the follwing data: Data_Covid_BD_wave_1_full_sample.dta

//generate "received treatment"
gen rec_treat2 = 1 if treat2==1 & treated==1
replace rec_treat2 = 0 if rec_treat2==.

gen rec_treat3 = 1 if treat3==1 & treated==1
replace rec_treat3 = 0 if rec_treat3==.


//Columns 1-2, not treated but surveyed
reg compidx treat2 treat3 Gender_res rel_islam i.occupation i.insec health_worry finance_worry i.UNION_CODE if treated==0, vce(cluster VILLAGE_ID)
outreg2 using robustbd1.tex, append ctitle(1) dec(3) keep(treat2 treat3)

test treat2 = treat3 //F-test p-value

reg compidx treat2 treat3 age_respondent edu_respondent Gender_res rel_islam log_income nmember i.occupation i.insec media_exp health_worry finance_worry i.UNION_CODE if treated==0, vce(cluster VILLAGE_ID)
outreg2 using robustbd1.tex, append ctitle(2) dec(3) keep(treat2 treat3) 

test treat2 = treat3 //F-test p-value

//Columns 3-4, full sample
reg compidx treat2 treat3 Gender_res rel_islam i.occupation i.insec health_worry finance_worry i.UNION_CODE, vce(cluster VILLAGE_ID)
outreg2 using robustbd1.tex, append ctitle(3) dec(3) keep(treat2 treat3)

test treat2 = treat3 //F-test p-value

reg compidx treat2 treat3 age_respondent edu_respondent Gender_res rel_islam log_income nmember i.occupation i.insec media_exp health_worry finance_worry i.UNION_CODE, vce(cluster VILLAGE_ID)
outreg2 using robustbd1.tex, append ctitle(4) dec(3) keep(treat2 treat3) 

test treat2 = treat3 //F-test p-value

//Columns 5-6, 2SLS
ivreg2 compidx (rec_treat2 rec_treat3 = treat2 treat3) Gender_res rel_islam i.occupation i.insec health_worry finance_worry i.UNION_CODE, robust cluster(VILLAGE_ID) first
outreg2 using robustbd1.tex, append ctitle(5) dec(3) keep(rec_treat2 rec_treat3)

test rec_treat2 = rec_treat3 //F-test p-value

ivreg2 compidx (rec_treat2 rec_treat3 = treat2 treat3) age_respondent edu_respondent Gender_res rel_islam log_income nmember i.occupation i.insec media_exp health_worry finance_worry i.UNION_CODE, robust cluster(VILLAGE_ID) first
outreg2 using robustbd1.tex, append ctitle(6) dec(3) keep(rec_treat2 rec_treat3) 

test rec_treat2 = rec_treat3 //F-test p-value

clear
*************************************************************************************************


*************************************************************************************************
*TABLE 5
/*
For this table, see the folder "4. Tables 5 and B21-24 ML Heterogeneity". Check the readme.txt file.
*/
*************************************************************************************************


***************************
* End of main replication *
***************************
